﻿using System;

namespace DevelopTool.Forms.TextProcessForms
{
    public static class AuxiliaryInputTips
    {
        private static AuxiliaryInputTipsForm auxiliaryInputTipsForm;

        /// <summary>
        /// 是否已取消输入
        /// </summary>
        public static bool IsCancel = false;

        /// <summary>
        /// 设置提示文本
        /// </summary>
        /// <param name="text"></param>
        public static void SetTipsText(string text)
        {
            if (auxiliaryInputTipsForm == null || auxiliaryInputTipsForm.IsDisposed)
            {
                auxiliaryInputTipsForm = new AuxiliaryInputTipsForm();
                auxiliaryInputTipsForm.Show();
            }
            
            auxiliaryInputTipsForm.Invoke(new Action(() =>
            {
                auxiliaryInputTipsForm.LblText = text;
            }));
        }


        public static void CloseTips()
        {
            if (auxiliaryInputTipsForm != null && !auxiliaryInputTipsForm.IsDisposed)
            {
                auxiliaryInputTipsForm.Dispose();
            }

        }

    }
}
